package ex105;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Calendar calendar = new Calendar();

        System.out.print("输入一个年份和该年第1天是星期几(0-6代表周日到周六), 用空格分隔: ");
        int year = scanner.nextInt();
        int weekDigit = scanner.nextInt();
        if (year <= 0 || weekDigit < 0 || weekDigit > 6) {
            System.out.println("不正确的输入");
        } else {
            calendar.year = year;
            calendar.weekDigitOfFirstDay = weekDigit;
            int[] weekDigits = calendar.getFirstWeekDigitsOfMonth();
            for (int digit : weekDigits) {
                System.out.print(digit + " ");
            }
            System.out.println();
        }
    }
}
